package com.guigu.controller;

import com.guigu.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/city/")
public class CityController {
    @Autowired
    CityService cityService;

    //根据pid，获取多个市
    @PostMapping("queryByPid.action")
    @CrossOrigin
    public List queryByPid(Integer id)
    {
        return cityService.queryByPid(id);
    }
}
